﻿namespace instamuz.Application.ViewModels
{
    using System.Collections.Generic;
    using System.Linq;
    using Domain.Dtos;
    using Domain.Entities;

    public class AccountFeedViewModel
    {
        public AccountFeedViewModel(Account contextAccount, Account account, IEnumerable<PostDto> posts)
        {
            AlreadyFollow = contextAccount == account || contextAccount.Following.Contains(account);
            CanPost = contextAccount == account;
            Posts = posts;
            AccountName = account.Login;
            AccountId = account.Id;
            ContextAccountId = contextAccount.Id;
        }

        public bool AlreadyFollow { get; set; }
        public bool CanPost { get; set; }
        public IEnumerable<PostDto> Posts { get; set; }
        public string AccountName { get; set; }
        public int AccountId { get; set; }
        public int ContextAccountId { get; set; }
    }
}